import { ArticleDetail } from '@/types/data'
import { ArticleAction } from '@/types/store'
type ArticleType = {
  info: ArticleDetail
}
const initValue: ArticleType = {
  info: {},
} as ArticleType

export default function article(
  state = initValue,
  action: ArticleAction
): ArticleType {
  if (action.type === 'article/getArticleDetail') {
    return { ...state, info: action.payload }
  }
  return state
}
